package com.flowerplus.store.common.data.http;


import com.flowerplus.store.Logger;
import com.flowerplus.store.common.execption.utils.ExceptionHandle;

import rx.Subscriber;

/**
 * Created by z on.
 * Des:
 * Date: 2017/6/2
 */

public abstract class BusCall<T> extends Subscriber<T> {
    private static final String TAG = "BusCall";

    @Override
    public void onCompleted() {
        Logger.d("BusCall onCompleted");
    }

    @Override
    public void onError(Throwable e) {
        e.printStackTrace();
        String handle = ExceptionHandle.handle(e);
        Logger.e(TAG, handle);
    }

    @Override
    public void onNext(T t) {
        call(t);
    }

    public abstract void call(T t);
}
